//
//  WealthViewController.m
//  TriumphInTheSkiesAPP
//
//  Created by 要帅气的生活 on 15/11/3.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "WealthViewController.h"
#import "Size.h"
#import "RootViewController.h"
#import "ScreeningViewController.h"
#import "PhotoViewController.h"
#import "ImageViewController.h"
@interface RootViewController ()

@end

@implementation WealthViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"财富";
    
    UIButton *sButton = [UIButton buttonWithType:UIButtonTypeSystem];
    sButton.frame = CGRectMake(0, 100, WindowWidth, 50);
    sButton.backgroundColor = [UIColor cyanColor];
    [sButton setTitle:@"筛选" forState:UIControlStateNormal];
    sButton.tag = 200;
    [sButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sButton];
    
    UIButton *datePickButton = [UIButton buttonWithType:UIButtonTypeSystem];
    datePickButton.frame = CGRectMake(0, 200, WindowWidth, 50);
    datePickButton.backgroundColor = [UIColor cyanColor];
    [datePickButton setTitle:@"筛选" forState:UIControlStateNormal];
    datePickButton.tag = 201;
    [datePickButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:datePickButton];
    
    UIButton *dateButton = [UIButton buttonWithType:UIButtonTypeSystem];
    dateButton.frame = CGRectMake(0, 300, WindowWidth, 50);
    dateButton.backgroundColor = [UIColor cyanColor];
    [dateButton setTitle:@"筛选" forState:UIControlStateNormal];
    dateButton.tag = 202;
    [dateButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:dateButton];
    
    UIButton *dButton = [UIButton buttonWithType:UIButtonTypeSystem];
    dButton.frame = CGRectMake(0, 400, WindowWidth, 50);
    dButton.backgroundColor = [UIColor cyanColor];
    [dButton setTitle:@"筛选" forState:UIControlStateNormal];
    dButton.tag = 203;
    [dButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:dButton];
    
    
}


- (void)pressButton:(UIButton *)btn{
    
    if (btn.tag == 200) {
        
        ScreeningViewController *screenVC = [[ScreeningViewController alloc] init];
        //    [self jump:nil to:screenVC];
        [self.navigationController pushViewController:screenVC animated:YES];
    }else if (btn.tag == 201){
        
        [self creatAlertView];
        
    }else if(btn.tag == 202){
        [self.navigationController pushViewController:[[PhotoViewController alloc] init] animated:YES];
        
    }else if (btn.tag == 203){
        [self.navigationController pushViewController:[[ImageViewController alloc] init] animated:YES];
    }
    
}

- (void)creatAlertView
{
    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:(UIAlertControllerStyleActionSheet)];
    UIAlertAction * ascendAction = [UIAlertAction actionWithTitle:@"按价格升序" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        
        
    }];
    UIAlertAction * descendAction = [UIAlertAction actionWithTitle:@"按价格降序" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
       
        
    }];
    UIAlertAction * defaultAction = [UIAlertAction actionWithTitle:@"默认排序" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        
        
    }];
    UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"h");
        
    }];
    [alertController addAction:ascendAction];
    [alertController addAction:descendAction];
    [alertController addAction:defaultAction];

    [alertController addAction:cancelAction];
    
    [self presentViewController:alertController animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
